
import 'package:json_annotation/json_annotation.dart';
import 'package:sjx/repository/model/type_and_tag_icon.dart';

//需要再根目录运行flutter pub run build_runner build才会得到这个文件
part 'home_list_model.g.dart';

@JsonSerializable()
class HomeListModel {
  final int count;
  final List<HomeListItemData>? taskListDetails;

  HomeListModel({
    required this.count,
    required this.taskListDetails
  });

  factory HomeListModel.fromJson(Map<String, dynamic> json) =>
      _$HomeListModelFromJson(json);
}


@JsonSerializable()
class HomeListItemData {
  final int approveCount;
  final int approvedUserCount;
  final int leftBidTime;
  final String readLink;
  final String rewardAmountDisplay;
  final String taskNo;
  final String taskStatusUrl;
  final String taskThumb;
  final String taskTitle;
  final String taskType;
  final String? thirdpartyKey;
  final List<TypeAndTagIcon> typeAndTagIcons;
  final String videoLink;

  HomeListItemData({
    required this.approveCount,
    required this.approvedUserCount,
    required this.leftBidTime,
    required this.readLink,
    required this.rewardAmountDisplay,
    required this.taskNo,
    required this.taskStatusUrl,
    required this.taskThumb,
    required this.taskTitle,
    required this.taskType,
    this.thirdpartyKey,
    required this.typeAndTagIcons,
    required this.videoLink,
  });

  factory HomeListItemData.fromJson(Map<String, dynamic> json) =>
      _$HomeListItemDataFromJson(json);

  Map<String, dynamic> toJson() => _$HomeListItemDataToJson(this);
}